<%@ page language="java" import="java.util.*,com.cqnu.util.*" contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":"
			+ request.getServerPort() + path;
	String uid=CommonUtil.getCookie(request, "uid");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>欢迎使用-请登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="<%=path%>/js/jquery.js"></script>
<link href="<%=path%>/style/login.css" rel="stylesheet" rev="stylesheet" type="text/css" media="all" />
<script type="text/javascript">
$(document).ready(function() {
	$("#<%="".equals(uid)?"user":"pass"%>").focus();
});

function refreshCode(img){
	img.src="<%=path%>/CodeImage"+ "?code=" + Math.random();
	$("#vcode").focus();
}

function checkform() {
	  if($("#user").val() == '') {
	    alert('请输入登录账号！');
	    $("#user").focus();
	    return false;
	  }
	  if($("#pass").val() == '') {
	    alert('请输入登录密码！');
	    $("#pass").focus();
	    return false;
	  }
	  if($("#vcode").val() == '') {
		    alert('请输入验证码！');
		    $("#vcode").focus();
		    return false;
		  }
	  return true;
	}
</script>
</head>

<body>
<div class="header">
  <h1 class="headerLogo"><img alt="logo" src="<%=path%>/images/login/logo_new.png" /></h1>
</div>
<div class="banner">
  <div class="login-aside">
    <div id="o-box-up"></div>
    <div id="o-box-down"  style="table-layout:fixed;">
    <div class="error-box">${message}</div>
      <form name="loginform" class="registerform" action="<%=path%>/login.do" method="post">
        <div class="fm-item">
          <label class="form-label">账号：</label>
          <input type="text" value="<%=uid%>"  id="user" name="user" maxlength="100"  class="i-text" />
        </div>
        <div class="fm-item">
          <label class="form-label">密码：</label>
          <input type="password" name="pass" id="pass" value="" maxlength="100" class="i-text" />
        </div>
        <div class="fm-item">
        	<label class="form-label"></label>
          <input type="radio" name="type" value="2" checked/><span class="yzm-label">学生</span>
          <input type="radio" name="type" value="1"/><span class="yzm-label">教师</span>
          <input type="radio" name="type" value="0"/><span class="yzm-label">管理员</span>
        </div>
        <!-- <div class="yzm">
          <span class="yzm-label">验证码：</span><input type="text" name="vcode" id="vcode" autocomplete="off" value="" maxlength="4" class="yzm" /><img src="<%=path%>/CodeImage" style="cursor:pointer" title="点击更换验证码" onclick="refreshCode(this)" />
        </div> -->
        <div class="fm-item">
        <label class="form-label"></label>
          <input type="submit" value="" class="btn-login" onclick="return checkform()" />
        </div>
      </form>
    </div>
  </div>
  <div class="bd">
    <ul>
      <li style="background:url(<%=path%>/images/login/backgroundPic.jpg) center 0 no-repeat;"></li>
    </ul>
  </div>
</div>
<div class="banner-shadow"></div>
<div class="footer">
  <p>Copyright &copy; 2016.  All rights reserved.</p>
</div>
</body>
</html>
